<!doctype html>
<html lang="cn" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="Mark Otto, Jacob Thornton, and Bootstrap contributors">
    <meta name="generator" content="Hugo 0.80.0">
    <title>评论管理</title>

    <!-- Bootstrap core CSS -->
    <link th:href="@{/css/bootstrap.css}" rel="stylesheet">

    <style>
        .bd-placeholder-img {
            font-size: 1.125rem;
            text-anchor: middle;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            user-select: none;
        }

        @media (min-width: 768px) {
            .bd-placeholder-img-lg {
                font-size: 3.5rem;
            }
        }
    </style>

    <link th:href="@{/css/dashboard.css}" rel="stylesheet">
</head>
<body>

<!--头部导航栏-->
<div th:replace="commons/common_admin::topNavigationBar(searchName=${commentName})"></div>

<div class="container-fluid">
    <div class="row">

        <!--侧边栏-->
        <div th:replace="commons/common_admin::sidebar(listComment)"></div>

        <!--内容-->
        <main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-md-4">

            <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3">
                <h1 class="h2">评论管理</h1>
            </div>

            <!--清除浮动-->
            <div class="clearfix"></div>

            <!--表格-->
            <div class="table-responsive">
                <table class="table table-striped table-sm">
                    <thead>
                    <tr class="text-center">
                        <!--<th>博客序号</th>-->
                        <th width="10%">评论人</th>
                        <th width="10%">手机号</th>
                        <th width="10%">博客id</th>
                        <th width="20%">内容</th>
                        <th width="10%">邮箱</th>
                        <th width="10%">审核状态</th>
                        <th width="15%">创建时间</th>
                        <th width="15%">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="comment:${comments.records}" class="text-center">
                        <td th:text="${comment.commentator}"></td>
                        <td th:text="${comment.phone}"></td>
                        <td th:text="${comment.blogTitle}"></td>
                        <td th:text="${#strings.abbreviate(comment.commentBody, 35)}" th:title="${comment.commentBody}"></td>
                        <td th:text="${#strings.isEmpty(comment.email) ? '无' : comment.email}"></td>
                        <td>
                            <a th:if="${#strings.equals(comment.commentStatus,'0')}"
                               class="btn btn-primary"
                               th:href="@{/admin/reviewComment/{commentId}(commentId=${comment.commentId})}">待审核
                            </a>
                            <a class="btn btn-success" th:if="${#strings.equals(comment.commentStatus,'1')}" href="#">已审核</a>
                        </td>
                        <td th:text="${#dates.format(comment.commentCreateTime, 'yyyy-MM-dd HH:mm:ss')}"></td>
                        <td>
                            <a class="btn btn-sm btn-danger" id="delete"
                               th:href="@{/admin/removeComment/{commentId}(commentId=${comment.commentId})}">删除</a>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>

            <!--分页-->
            <!--<div>-->
            <!--    当前第 [[${comments.current}]] 页，共 [[${comments.pages}]] 页，共 [[${comments.total}]] 条-->
            <!--    <nav aria-label="Page navigation example" th:if="${comments.pages>0}">-->
            <!--        <ul class="pagination justify-content-center">-->
            <!--            <li th:class="${comments.current == 1 ? 'page-item disabled' : 'page-item'}">-->
            <!--                <a class="page-link" th:if="${comments.current == 1}"-->
            <!--                   th:href="@{/admin/listCategory(current=1,searchName=${categoryName})}">Previous</a>-->
            <!--                <a class="page-link" th:if="${comments.current != 1}"-->
            <!--                   th:href="@{/admin/listCategory(current=${comments.current - 1},searchName=${categoryName})}">Previous</a>-->
            <!--            </li>-->
            <!--            &lt;!&ndash;<li class="page-item active" aria-current="page"><span class="page-link">2</span></li>&ndash;&gt;-->

            <!--            <li th:class="${comments.current == pages ? 'page-item active' : 'page-item'}"-->
            <!--                th:each="pages:${#numbers.sequence(1, comments.pages)}">-->
            <!--                <a class="page-link" th:href="@{/admin/listCategory(current=${pages},searchName=${categoryName})}" th:text="${pages}"></a>-->
            <!--            </li>-->
            <!--            <li th:class="${comments.current == comments.pages ? 'page-item disabled' : 'page-item'}">-->
            <!--                <a class="page-link" th:if="${comments.current == comments.pages}"-->
            <!--                   th:href="@{/admin/listCategory(current=${comments.current},searchName=${categoryName})}">Next</a>-->
            <!--                <a class="page-link" th:if="${comments.current != comments.pages}"-->
            <!--                   th:href="@{/admin/listCategory(current=${comments.current + 1},searchName=${categoryName})}">Next</a>-->
            <!--            </li>-->
            <!--        </ul>-->
            <!--    </nav>-->
            <!--</div>-->


        </main>
    </div>
</div>


<div th:replace="commons/common_admin::adminJs"></div>
<div th:replace="commons/common_admin::searchBlogJs(listItem='listComment')"></div>
</body>
</html>
